@echo off    

color 0A
set OsVersion=0
@rem Windows Server 2003
ver|findstr /r /i "5.2.*" > NUL && goto LowerVersion
@rem Windows Server 2008
ver|findstr /r /i "6.0.*" > NUL && goto LowerVersion
@rem Windows Server 2008 R2
ver|findstr /r /i "6.1.*" > NUL && goto LowerVersion
@rem Windows Server 2012
ver|findstr /r /i "6.2.*" > NUL && goto OtherVersion
@rem Windows Server 2012  R2
ver|findstr /r /i "6.3.*" > NUL && goto OtherVersion
@rem Windows Server 2016
ver|findstr /r /i "10.0.*" > NUL && goto OtherVersion
:otherServer
  
:LowerVersion
set OsVersion=under Windows Server 2008 R2
goto install_NET2
 
:OtherVersion
set OsVersion=above Windows Server 2008
goto install

:install_NET2
echo current os version is %OsVersion%
:: 此处需要修改为真正的服务
echo [服务名 install]================ start ================
JarInstaller.NET2.exe install
echo [space] ........ 
echo [install success]
goto startService 

:install
echo current os version is %OsVersion%
:: 此处需要修改为真正的服务
echo [服务名 install]================ start ================
JarInstaller.exe install
echo [space] ........ 
echo [install success]
goto startService 

:startService
:: 此处需要修改为真正的服务
net start 服务名
echo [start success]================ end ================ 
